if exists('ENVARC:AACD/AminetIndex') then AminetPath = AddPart(GetVar('AACD/AminetIndex'),'')
else AminetPath = CDname':AACD/Online/Aminet/'
OutFile = 'T:SearchCDs.results'
;;;
/* ;;; Define MUI variables */
MUIA_List_Quiet = 0x8042d8c7
MUIM_List_Select = 0x804252d8
MUIV_List_Select_All = -2
MUIV_List_Select_On = 1
MUIV_List_Select_Ask = 3
MUIA_List_First = 0x804238d4
MUIM_List_Remove = 0x8042647e
MUIV_List_Remove_Selected = -3
MUIA_List_Entries = 0x80421654
MUIA_List_Quiet = 0x8042d8c7
MUIA_Listview_MultiSelect = 0x80427e08
MUIV_Listview_MultiSelect_Default = 1
MUIA_Gauge_Current = 0x8042f0dd
MUIA_Gauge_Divide = 0x8042d8df
MUIA_Gauge_Horiz = 0x804232dd
MUIA_Gauge_InfoText = 0x8042bf15
MUIA_Gauge_Max = 0x8042bcdb
MUIA_Group_Columns = 0x8042f416
MUIA_Menuitem_Shortcut = 0x80422030
MUIA_Application_Active = 0x804260ab
MUIA_Application_Author = 0x80424842
MUIA_Application_Copyright = 0x8042ef4d
MUIA_Application_Description = 0x80421fc6
MUIA_Application_HelpFile = 0x804293f4
MUIA_Application_Iconified = 0x8042a07f
MUIA_Application_Title = 0x804281b8
MUIA_Application_Version = 0x8042b33f
MUIA_Application_Sleep = 0x80425711
MUIM_Application_AboutMUI = 0x8042d21d
TRUE = 1
FALSE = 0
;;;
/* ;;; Load libraries */
call LoadLib('rexxsupport.library')
call LoadLib('rexxdossupport.library')
call LoadLib('rexxreqtools.library')
;;;
/* ;;; Open arexx port and GUI */
thisport = openport(PrgPort)
if thisport = 0 then exit
address(GuiPort)
window id MAIN port PrgPort command 'QUIT' title '"'WinTitle'"'
group id ALL
group horiz attrs MUIA_Group_Columns 2
label double 'Search string'
string id SCSTR help '"Enter a string to search for"' /*content 'test'*/
label double 'CDs to search'
cycle id CDTYP port PrgPort command 'RESCAN' help '"Which types of CD do\nyou wish to search?"' labels 'Amiga Active CDs,Aminet CDs,Aminet Sets,Aminet Online'
label double 'Output format'
cycle id OPFMT help '"Choose the output format"' labels 'HTML,Text'
endgroup
list id CDLST attrs MUIA_Listview_MultiSelect MUIV_Listview_MultiSelect_Default help '"Select the CDs to search"'
group id BTNS horiz
button id GO port PrgPort command 'SEARCH' help '"Start the search"' label 'Search'
button id ALL port PrgPort command 'ALL' help '"Select all CDs in the list"' label 'Select All'
button id ESC port PrgPort command 'QUIT' '"Exit without searching"' label 'Cancel'
endgroup
gauge id PROGR attrs MUIA_Gauge_Horiz MUIA_Gauge_InfoText '' help '"Shows the progress of the search"' label ''
endgroup
menu id PROJM label 'Project'
item id ABOUT port PrgPort command 'ABOUT' MUIA_Menuitem_Shortcut '?' label 'About'
item id MUI port PrgPort command 'ABOUTMUI' label 'About MUI...'
item id QUITM port PrgPort command 'QUIT' MUIA_Menuitem_Shortcut 'Q' label 'Quit'
line = '<tr><td><a href="'path'">'name'<td align=right>'strip(size)'<td align=right>'strip(age)'<td><a href="'readme'">'desc'</a>'
call writeln(out,line)
'gauge id PROGR attrs' MUIA_Gauge_Current BytesDone
end
call writeln(out,'<tr><td align=center colspan=4><p><hr><p><h5>The age is given in weeks since the date of this index ('date('N',word(statef(AddPart(IndexPath,'INDEX')),5),'I')')</h5>')
end
otherwise call ShowMsg('Not done this bit yet')
end
call writeln(out,'</table></body></html>')
call close(res)
call close(out)
/* Load HTML */
address command 'waitforport' AWebPort
if RC > 0 then call ExitMsg('Unable to start AWeb')
/*call delete(OutFile)*/
call delete(OutFile'.html')
call rename(OutFile'1',OutFile'.html')
address(AWebPort)
'open file://localhost/'OutFile'.html reload'
'screentofront'
'window tofront'
end
;;;
/* ;;; Show amigaguide */
when Format = 'AmigaGuide' then do
call ShowMsg('Not done this bit yet')
end
otherwise do
call ShowMsg('Not done this bit yet')
call close(res)
call close(out)
return
end
end
call close(res)
call close(out)
address(GuiPort)
'gauge id PROGR attrs' MUIA_Gauge_Current 0 MUIA_Gauge_InfoText '""'
return
;;;
/* ;;; List CDs for searching */
LoadList:
address(GuiPort)
'list id CDLST attrs' MUIA_List_Quiet TRUE
'application' MUIA_Application_Sleep TRUE
/* Clear list */
'method id CDLST' MUIM_List_Select MUIV_List_Select_All MUIV_List_Select_On
'method id CDLST' MUIM_List_Remove MUIV_List_Remove_Selected